<%@ page contentType="text/html" pageEncoding="UTF-8" language="java"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<div class="box">
  <h2>Liste des paris</h2>
  <div class="box-content">
    <form method="post" action="#">
      <table cellspacing="0" cellpadding="0" id="list-of-bets" class="dataview">
        <thead>
          <tr>
            <td><input type="checkbox" name="checkAll" value="0" /></td>
            <td><a href="#sort">Nom</a></td>
            <td><a href="#sort">Catégorie</a></td>
            <td><a href="#sort" title="Date de création">Création</a></td>
            <td><a href="#sort" title="Date de début">Début</a></td>
            <td><a href="#sort" title="Date de fin">Fin</a></td>
            <td><a href="#sort">&nbsp;</a></td>
          </tr>
        </thead>
        <tfoot>
          <tr>
            <td colspan="7">
              <ul class="list-of-actions">
                <li><a href="#validate">Valider</a></li>
                <li><a href="#cancel">Annuler</a></li>
                <li><a href="#remove">Supprimer</a></li>
              </ul>
            </td>
          </tr>
          <tr>
            <td colspan="7" class="right">
              <form id="create-new-bet" method="post" action="#new-bet">
                <div>
                  <input type="text" name="betName" value="" size="60" />
                  <div id="submit-new-bet" class="submit-button">
                    <div class="top"></div>
                    <div class="content">Ajouter</div>
                  </div>
                </div>
              </form>
            </td>
          </tr>
        </tfoot>
        <tbody>
          <c:forEach items="${bets}" var="b">
            <tr>
              <td><input type="checkbox" name="check" value="<c:out value="${b.id}"/>" /></td>
              <td><a href="#beti" rel="<c:out value="${b.id}"/>"><c:out value="${b.name}"/></a></td>
              <td><c:out value="${b.sectionName}"/></td>
              <td><c:out value="${b.creationTimeFormatted}"/></td>
              <td><c:out value="${b.startTimeFormatted}"/></td>
              <td><c:out value="${b.endTimeFormatted}"/></td>
              <td>
                <div class="light
                     <c:choose>
                       <c:when test="${!b.status}">red</c:when>
                       <c:when test="${b.status}">green</c:when>
                     </c:choose>">
                  <img alt="light" title="
                     <c:choose>
                       <c:when test="${!b.status}">Inactif</c:when>
                       <c:when test="${b.status}">Actif</c:when>
                     </c:choose>
                       "src="/img/adm/light.png">
                </div>
              </td>
            </tr>
          </c:forEach>
        </tbody>
      </table>
    </form>
  </div>
</div>